package com.anhry.app.safety.manage.tjfx.struts.action;

import java.io.ByteArrayOutputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.anhry.app.safety.manage.enterprise.bean.TbCorpType;
import com.anhry.app.safety.manage.system.bean.TbUser;
import com.anhry.app.safety.manage.system.bean.TbUserDept;
import com.anhry.app.safety.manage.tjfx.struts.base.ExportExcel;
import com.anhry.app.safety.manage.tjfx.struts.base.TjfxCorpBaseAction;
import com.anhry.app.safety.util.Loggers;
import com.anhry.app.safety.util.Page;
import com.anhry.app.safety.util.Util;

@Controller
@Scope("prototype")
@SuppressWarnings("unchecked")
public class TjSdCorp extends TjfxCorpBaseAction {

	private Logger logger = Logger.getLogger(TjSdCorp.class); 
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private List htmlList;

	private String totalCounts;

	private String unitId;

	private String tjType;

	private String upLevelName;// 上一级连接查询主体名称

	private String initType;

	private List sumList;// 合计列表

	private String xmlString;// 图标xml

	private List corpList;// 企业列表

	private String corpGrade;// 企业级别

	private String countyId;// 属地id

	private String hyId;// 行业id

	private String maxTypeId;// 大类id

	private String minTypeId;// 小类id

	private String exportExcelFlag;// 是否导出excel 如果导出excel，则返回null 否则返回success

	private String tjTypeFlag;// 用于查找企业列表标示统计类别

	private String tjTypeFlag2;//
	
	private String tjTypeFlag3;//
	private String tjTypeFlag4;//

	private String htmlTitle;

	public String getHtmlTitle() {
		return htmlTitle;
	}

	public void setHtmlTitle(String htmlTitle) {
		this.htmlTitle = htmlTitle;
	}

	public String getTjTypeFlag2() {
		return tjTypeFlag2;
	}

	public void setTjTypeFlag2(String tjTypeFlag2) {
		this.tjTypeFlag2 = tjTypeFlag2;
	}

	/**
	 * 企业数属地统计
	 * 
	 * @return
	 */
	public String getShudiTj() {
		try {
			this.setHtmlTitle("属地名称");
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			int grade = Integer.parseInt(user.getTbUserGrade().getId() + "");
			// 企业对应信息
			StringBuffer hql1 = new StringBuffer("select ?,i.corp_Grade ,count(*) from Tb_Tj_Corp_Info_View i where 1=1  ");
			// 企业总数
			StringBuffer hql3 = new StringBuffer("select count(*) from Tb_Corp_Info_view c where 1=1 ");
			StringBuffer str = new StringBuffer("");
			if (grade != 0 && grade != 1 && grade != 2 && grade != 8 && grade != 4 && grade != 3 && grade != 5 && grade != 6) {
				if (grade == 7) {// 属地登陆
					if (user.getTbUserDept() != null) {
						tjTypeFlag2 = "unit_id";
						hql1 = new StringBuffer(hql1.toString().replace("?", "i.unit_Id,i.unit_Name"));
						hql1.append(" and i.unit_id = ").append(user.getTbUserDept().getId());
						hql3.append(" and c.unit_id = ").append(user.getTbUserDept().getId());
						hql1.append(" and i.is_Dele=0 and i.corp_Size=1 group by( i.unit_Id,i.unit_Name,i.corp_Grade)");
					} else {
						tjTypeFlag2 = "county_id";
						hql1 = new StringBuffer(hql1.toString().replace("?", "i.county_Id,i.county_Name"));
						hql1.append(" and i.county_id=").append(user.getTbUserUnit().getId());
						hql3.append(" and c.county_id=").append(user.getTbUserUnit().getId());
						hql1.append(" and i.is_Dele=0 and i.corp_Size=1 group by( i.county_Id,i.county_Name,i.corp_Grade)");
					}
				}
			} else {
				tjTypeFlag2 = "county_id";
				if (grade != 0 && grade != 1) {
					if (user.getTbUserDept() != null && (user.getTbUserDept().getDeptGrade().equals("3"))) {
						hql1.append(" and i.county_id=").append(user.getTbUserUnit().getId());
						hql3.append(" and c.county_id=").append(user.getTbUserUnit().getId());
					}
					if(grade == 3 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//市科室--行业监管 
						tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getId();
						hql1.append(" and i.hy_id=").append(user.getTbUserDept().getId());
						hql3.append(" and c.dept_main_id=").append(user.getTbUserDept().getId());
					} else if(grade == 4 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//区科室
						tjTypeFlag4 = "qu_dept_ids:"+user.getTbUserDept().getId();
						hql1.append(" and i.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
						hql3.append(" and c.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
					}
					
				}
				if (user.getTbUserDept() != null && (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291"))) {
					tjTypeFlag2 = "county_id";
					tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getId();
					hql1.append(" and i.hy_id = ").append(user.getTbUserDept().getId());
					hql3.append(" and c.dept_main_id = ").append(user.getTbUserDept().getId());
				} else if (user.getTbUserDept() != null && user.getTbUserDept().getDeptClass().equals("2") && user.getTbUserDept().getDeptGrade().equals("3") && user.getTbUserDept().getDeptType().toString().equals("2")) {// 行业登陆
					tjTypeFlag2 = "county_id";
//					tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getId();
					hql1.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
					hql3.append(" and c.dept_main_id = ").append(user.getTbUserDept().getDeptSj()).append(" and c.county_id = ").append(user.getTbUserDept().getDeptParentId());
				} else if (user.getTbUserUnit() != null && user.getTbUserUnit().getDeptType().toString().equals("2") && user.getTbUserUnit().getDeptClass().equals("2") && user.getTbUserUnit().getDeptGrade().toString().equals("2")) {
//					tjTypeFlag3 = "hy_id:"+user.getTbUserUnit().getId();
				} else if (grade == 5 || grade == 6) {
					if (user.getTbUserDept() != null) {
						tjTypeFlag2 = "county_id";
						tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getDeptSj();
						hql1.append(" and i.hy_id = ").append(user.getTbUserDept().getDeptSj()).append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
						hql3.append(" and c.dept_main_id = ").append(user.getTbUserDept().getDeptSj()).append(" and c.county_id = ").append(user.getTbUserDept().getDeptParentId());
					} else {
						tjTypeFlag2 = "county_id";
						tjTypeFlag3 = "hy_id:"+user.getTbUserUnit().getId();
						hql1.append(" and i.hy_id = ").append(user.getTbUserUnit().getId());
						hql3.append(" and c.dept_main_id = ").append(user.getTbUserUnit().getId());
					}
				}
				hql1 = new StringBuffer(hql1.toString().replace("?", "i.county_Id,i.county_Name"));
				hql1.append(" and i.is_Dele=0 and i.corp_Size=1 group by(i.county_Id,i.county_Name,i.corp_Grade)");
			}
			hql3.append(" and c.is_Dele=0 and c.corp_Size=1");
			List sdList = getDeptList();
			this.initPageData(hql1.toString(), sdList, hql3.toString(), str, "", "属地");
			this.setResult("tj_corp_sd_list");
			
			if(logger.isDebugEnabled()) {
				logger.debug("hql1 ---> " + hql1 );
				logger.debug("hql3 ---> " + hql3 );
			}
			if (exportExcelFlag == null || exportExcelFlag.equals("")) {
				return SUCCESS;
			} else {
				return null;
			}
		} catch (Exception e) {
			Loggers.error("TjSdCorp getShudiTj 出错" + e);
			e.printStackTrace();
		}
		return ERROR;
	}

	/**
	 * 企业数行业统计
	 * 
	 * @return
	 */
	public String getHyTj() {
		try {
			htmlTitle = "行业名称";
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			int grade = Integer.parseInt(user.getTbUserGrade().getId() + "");
			StringBuffer hql1 = new StringBuffer("select i.hy_Id,i.hy_Name,i.corp_Grade ,count(*) from Tb_Tj_Corp_Info_View i where 1=1 ");
			StringBuffer hql3 = new StringBuffer("select count(*) from Tb_Corp_Info_view c where 1=1");
			StringBuffer str = new StringBuffer("");
			if (grade != 0 && grade != 1 && grade != 2 && grade != 5 && grade != 6) {
				if (grade == 7) {
					if (user.getTbUserDept() != null) {
						tjTypeFlag3 = "unit_id:"+user.getTbUserDept().getId();
						hql1.append(" and i.unit_id = ").append(user.getTbUserDept().getId());
						hql3.append(" and c.unit_id = ").append(user.getTbUserDept().getId());
					} else {
						tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
						hql1.append(" and i.county_id=").append(user.getTbUserUnit().getId());
						hql3.append(" and c.county_id=").append(user.getTbUserUnit().getId());
					}
				} else if (grade == 8) {
					tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
					hql1.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
					hql3.append(" and c.county_id = ").append(user.getTbUserDept().getDeptParentId());
				} else if (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291")) {
					hql1.append(" and i.hy_id = ").append(user.getTbUserDept().getId());
					hql3.append(" and c.dept_main_id = ").append(user.getTbUserDept().getId());
				}
			}
			tjTypeFlag2 = "hy_id";
			if (grade != 0 && grade != 1) {
				if(grade == 3 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//市科室--行业监管 
					tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getId();
					hql1.append(" and i.hy_id=").append(user.getTbUserDept().getId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserDept().getId());
				} else if(grade == 4 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//区科室
					tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
					hql1.append(" and i.county_id=").append(user.getTbUserUnit().getId());
					hql3.append(" and c.county_id=").append(user.getTbUserUnit().getId());
					hql1.append(" and i.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
					hql3.append(" and c.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
				}
			}
			if ((user.getTbUserDept() != null && grade != 7) && (user.getTbUserDept().getDeptClass().equals("1") && (user.getTbUserDept().getDeptGrade().toString().equals("2") || user.getTbUserDept().getDeptGrade().toCharArray().equals("3")) && user.getTbUserDept().getDeptType().toString().equals("2"))) {
				if (grade == 5) {
					hql1.append(" and i.hy_id=").append(user.getTbUserUnit().getId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserUnit().getId());
				} else if (grade == 6) {
					hql1.append(" and i.hy_id=").append(user.getTbUserDept().getDeptSj()).append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserDept().getDeptSj()).append(" and c.dept_main_id = ").append(user.getTbUserDept().getDeptParentId());
				}
			}

		/*	if ((user.getTbUserDept() != null && grade != 7) && (user.getTbUserDept().getDeptGrade().equals("3"))) {
				tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
				hql1.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
				hql3.append(" and c.dept_main_id = ").append(user.getTbUserDept().getDeptParentId());
			}*/
			hql1.append(" and i.is_Dele=0 and i.corp_Size=1 group by( i.hy_Id,i.hy_Name,i.corp_Grade)");
			hql3.append(" and c.is_Dele=0 and c.corp_Size=1");
			this.initPageData(hql1.toString(), getHyList(), hql3.toString(), str, "", "行业");
			this.setResult("tj_corp_hy_list");
			if (exportExcelFlag == null || exportExcelFlag.equals("")) {
				return SUCCESS;
			} else {
				return null;
			}
		} catch (Exception e) {
			Loggers.error("TjSdCorp getHyTj 出错" + e);
			e.printStackTrace();
		}
		return ERROR;
	}

	/**
	 * 按企业类型统计
	 * 
	 * @return
	 */
	public String getTypeTj() {
		try {
			htmlTitle = "大类名称";
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			int grade = Integer.parseInt(user.getTbUserGrade().getId() + "");
			StringBuffer hql1 = new StringBuffer("select i.max_type_Id,i.max_type_Name,i.corp_Grade ,count(*) from Tb_Tj_Corp_Info_View i where 1=1 ");
			StringBuffer hql3 = new StringBuffer("select count(*) from Tb_Corp_Info_view c where 1=1");
			StringBuffer str = new StringBuffer("");
			if (grade != 0 && grade != 1 && grade != 2 && grade != 5 && grade != 6) {
				if (grade == 7) {
					if (user.getTbUserDept() != null) {
						tjTypeFlag3 = "unit_id:"+user.getTbUserDept().getId();
						hql1.append(" and i.unit_id = ").append(user.getTbUserDept().getId());
						hql3.append(" and c.unit_id = ").append(user.getTbUserDept().getId());
					} else {
						tjTypeFlag3 = "unit_id:"+user.getTbUserUnit().getId();
						hql1.append(" and i.county_id=").append(user.getTbUserUnit().getId());
						hql3.append(" and c.county_id=").append(user.getTbUserUnit().getId());
					}
				} else if (grade == 8) {
					tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
					hql1.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
					hql3.append(" and c.county_id = ").append(user.getTbUserDept().getDeptParentId());
				} else if (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291")) {
					tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getId();
					hql1.append(" and i.hy_id = ").append(user.getTbUserDept().getId());
					hql3.append(" and c.dept_main_id = ").append(user.getTbUserDept().getId());
				}
			}
			tjTypeFlag2 = "max_type_id";
			if (grade != 0 && grade != 1) {
				if(grade == 3 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//市科室--行业监管 
					tjTypeFlag3 = "hy_id:"+user.getTbUserDept().getId();
					hql1.append(" and i.hy_id=").append(user.getTbUserDept().getId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserDept().getId());
				} else if(grade == 4 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//区科室
					tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
					hql1.append(" and i.county_id=").append(user.getTbUserUnit().getId());
					hql3.append(" and c.county_id=").append(user.getTbUserUnit().getId());
					hql1.append(" and i.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
					hql3.append(" and c.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
				}
			} else if ((user.getTbUserDept() != null && grade != 7) && (user.getTbUserDept().getDeptClass().equals("1") && (user.getTbUserDept().getDeptGrade().toString().equals("2") || user.getTbUserDept().getDeptGrade().toCharArray().equals("3")) && user.getTbUserDept().getDeptType().toString().equals("2"))) {
				if (grade == 5) {
					hql1.append(" and i.hy_id=").append(user.getTbUserUnit().getId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserUnit().getId());
				} else if (grade == 6) {
					hql1.append(" and i.hy_id=").append(user.getTbUserDept().getDeptSj()).append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserDept().getDeptSj());
				}
			} else {
				if ((user.getTbUserDept() != null && grade != 7) && (user.getTbUserDept().getDeptGrade().equals("3"))) {
					tjTypeFlag3 = "county_id:"+user.getTbUserUnit().getId();
					hql1.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
					hql3.append(" and c.dept_main_id=").append(user.getTbUserDept().getDeptParentId());
				}
			}
			hql1.append(" and i.is_Dele=0 and i.corp_Size=1 group by( i.max_type_Id,i.max_type_Name,i.corp_Grade)");
			hql3.append(" and c.is_Dele=0 and c.corp_Size=1");
			List list;
			if (user.getTbUserDept() != null) {// 区
				list = getMaxTypeList(user.getTbUserDept().getId().toString());
			} else if (user.getTbUserUnit() != null) {// 市
				list = getMaxTypeList(user.getTbUserUnit().getId().toString());
			} else {
				list = getMaxTypeList("");// 管理员
			}
			this.initTypePageData(hql1.toString(), list, hql3.toString(), str, "", "企业类型大类");
			this.setResult("tj_corp_type_list");
			if (exportExcelFlag == null || exportExcelFlag.equals("")) {
				return SUCCESS;
			} else {
				return null;
			}
		} catch (Exception e) {
			Loggers.error("TjSdCorp getTypeTj 出错" + e);
			e.printStackTrace();
		}
		return ERROR;
	}

	/**
	 * 属地，乡镇，行业，大类，小类统计
	 * 
	 * @return
	 */
	public String getShudiTypeTj() {
		TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		int grade = Integer.parseInt(user.getTbUserGrade().getId() + "");
		Long total = 0L;
		if (totalCounts != null && !"".equals(totalCounts)) {// 企业总数
			total = Long.valueOf(totalCounts);
		}
		upLevelName = checkSearch(upLevelName);// 企业上一级连接名称 在分类最左列显示的数据
		StringBuffer str = new StringBuffer("");
		StringBuffer hql2 = new StringBuffer("select ?,!, i.corp_Grade , count(*) from Tb_tj_Corp_Info_view i where 1=1 ");

		if (initType.equals("1")) {// 点击属地统计
			// excel导出用
			if (tjType == null || tjType.equals("null")) {
				tjType = "2";
			}
			this.setResult("tj_corp_sd_type_list");
			if (grade != 0 && grade != 1 && grade != 2 && grade != 8 && grade != 3 && grade != 4 && grade != 5 && grade != 6) {
				if (grade == 7) {
					if (user.getTbUserDept() != null) {
						hql2.append(" and i.unit_id=").append(user.getTbUserDept().getId()).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
					} else {
						hql2.append(" and i.county_id=").append(user.getTbUserUnit().getId()).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
					}
				}
				
			} else {
				if (grade != 0 && grade != 1) {
					if(grade == 3 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//市科室--行业监管 
						hql2.append(" and i.hy_id=").append(user.getTbUserDept().getId());
						
					} else if(grade == 4 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//区科室
						hql2.append(" and i.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
						
					}
				}
				
				if (user.getTbUserDept() != null && (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291"))) {
					hql2.append(" and i.hy_id=").append(user.getTbUserDept().getId()).append(" and i.county_id=").append(unitId).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
				} else if (user.getTbUserDept() != null && user.getTbUserDept().getDeptClass().equals("2") && user.getTbUserDept().getDeptGrade().equals("3") && user.getTbUserDept().getDeptType().toString().equals("2")) {// 行业登陆
					tjTypeFlag2 = "unit_id";
					hql2.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId()).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
				} else if (user.getTbUserUnit() != null && user.getTbUserUnit().getDeptType().toString().equals("2") && (user.getTbUserUnit().getDeptClass().equals("2") && (user.getTbUserUnit().getDeptGrade().toString().equals("2")))) {
					hql2.append(" and i.county_id=").append(unitId).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
				} else if (grade == 5 || grade == 6) {
					if (grade == 5) {
						hql2.append(" and i.hy_id=").append(user.getTbUserUnit().getId()).append(" and i.county_id=").append(unitId).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
					} else if (grade == 6) {
						hql2.append(" and i.hy_id=").append(user.getTbUserDept().getDeptSj()).append(" and i.county_id=").append(unitId).append(" and i.is_Dele = 0  and i.corp_Size=1  and i.county_id is not null ").append(" group by( ?,!, i.corp_Grade )");
					}
				} else {
					hql2.append(" and i.county_id = ").append(unitId).append(" and i.is_Dele = 0  and i.corp_Size=1 ").append(" group by( ?,!, i.corp_Grade )");
				}
			}
		} else if (initType.equals("2")) {// 点击行业统计
			// excel导出用
			if (tjType == null || tjType.equals("null")) {
				tjType = "4";
			}
			this.setResult("tj_corp_hy_type_list");
			if (grade != 0 && grade != 1) {
				if (user.getTbUserGrade().getId().toString().equals("3")) {
					if(grade == 3 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//市科室--行业监管 
						hql2.append(" and i.hy_id=").append(user.getTbUserDept().getId());
						
					} else if(grade == 4 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//区科室
						hql2.append(" and i.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
						
					}
				}
			}
			if ((user.getTbUserDept() != null && grade != 7) && (user.getTbUserDept().getDeptClass().equals("1") && (user.getTbUserDept().getDeptGrade().toString().equals("2") || user.getTbUserDept().getDeptGrade().toCharArray().equals("3")) && user.getTbUserDept().getDeptType().toString().equals("2"))) {
				if (grade == 6) {
					hql2.append(" and i.hy_id = ").append(user.getTbUserDept().getDeptSj()).append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
				} else {
					hql2.append(" and i.hy_id = ").append(unitId);
				}
			} else {
				if ((user.getTbUserDept() != null && grade != 7) && (user.getTbUserDept().getDeptGrade().equals("3"))) {
					hql2.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
				}
				hql2.append(" and i.hy_id = ").append(unitId);
			}
			if (grade == 7) {
				if (user.getTbUserDept() != null) {
					hql2.append(" and i.unit_id =").append(user.getTbUserDept().getId());
				} else {
					hql2.append(" and i.county_id =").append(user.getTbUserUnit().getId());
				}
			}
			if (grade == 8) {
				hql2.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
			} else if (grade == 4) {
				hql2.append(" and i.county_id = ").append(user.getTbUserUnit().getId());
			} else if (user.getTbUserDept() != null && (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291"))) {

			}
			hql2.append(" and i.is_Dele = 0  and i.corp_Size=1  ").append(" group by( ?,!, i.corp_Grade )");
		} else if (initType.equals("3")) {// 点击类型统计
			// excel导出用
			if (tjType == null || tjType.equals("null")) {
				tjType = "4";
			}
			this.setResult("tj_corp_type_type_list");
			if (grade != 0 && grade != 1) {
				if (user.getTbUserGrade().getId().toString().equals("3")) {
					if(grade == 3 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//市科室--行业监管 
						hql2.append(" and i.hy_id=").append(user.getTbUserDept().getId());
						
					} else if(grade == 4 && user.getTbUserDept() != null && "3".equals(user.getTbUserDept().getDeptClass())) {//区科室
						hql2.append(" and i.qu_dept_ids like '%").append(user.getTbUserDept().getId()).append("%' ");
					}
				}
			}
			if (grade == 7) {
				if (user.getTbUserDept() != null) {
					hql2.append(" and i.unit_id =").append(user.getTbUserDept().getId());
				} else {
					hql2.append(" and i.county_id =").append(user.getTbUserUnit().getId());
				}
			}
			if (grade == 8) {
				hql2.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
			} else if (grade == 4) {
				hql2.append(" and i.county_id = ").append(user.getTbUserUnit().getId());
			} else if (user.getTbUserDept() != null && (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291"))) {
				hql2.append(" and i.hy_id = ").append(user.getTbUserDept().getId());
			} else if (user.getTbUserDept() != null && user.getTbUserDept().getDeptClass().equals("2") && user.getTbUserDept().getDeptGrade().equals("3") && user.getTbUserDept().getDeptType().toString().equals("2")) {// 行业登陆
//				tjTypeFlag2 = "unit_id";
				hql2.append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
			} else if (user.getTbUserUnit() != null && user.getTbUserUnit().getDeptType().toString().equals("2") && (user.getTbUserUnit().getDeptClass().equals("2") && (user.getTbUserUnit().getDeptGrade().toString().equals("2")))) {
				
			} else if (grade == 5 || grade == 6) {
				if (user.getTbUserGrade().getId().toString().equals("5")) {
					hql2.append(" and hy_id = ").append(user.getTbUserUnit().getId());
				} else if (user.getTbUserGrade().getId().toString().equals("6")) {
					hql2.append(" and hy_id = ").append(user.getTbUserDept().getDeptSj()).append(" and i.county_id = ").append(user.getTbUserDept().getDeptParentId());
				}
			}
			hql2.append(" and i.max_type_id = ").append(unitId).append(" and i.is_Dele = 0  and i.corp_Size=1  ").append(" group by( ?,!, i.corp_Grade )");
		}
		String hqlString = hql2.toString();
		List typeList;// （属地，乡镇，行业，大类，小类统计） 列表
		try {

			String titleName;
			if ("2".equals(tjType)) {// 乡镇
				htmlTitle = "乡镇名称";
				tjTypeFlag = "unit_id";
				this.setTjType("2");
				titleName = "乡镇";
				typeList = getUnitList(unitId);
				hqlString = hqlString.replace(" group ", " and i.unit_id is not null group ");// 有的企业没有乡镇级别属地
				// 加上判断乡镇非空的条件
				hqlString = hqlString.replace("?", "i.unit_id");
				hqlString = hqlString.replace("!", "i.unit_name");
				this.initPageData(hqlString, typeList, "", str, total + "", titleName);
			} else if ("5".equals(tjType)) { // 小类
				htmlTitle = "企业小类名称";
				tjTypeFlag = "min_type_id";
				this.setTjType("5");
				titleName = "企业类型小类";
				List<String> typeIds = new ArrayList<String>();
				if (initType.equals("1")) {
//					hqlString = hqlString.replace(" group ", " and i.unit_id is not null group ");
				}
				if (initType.equals("3")) {// 点类型统计查小类 传大类ID deptID为空
					typeList = getMinTypeList(unitId, null, "");
				} else if (initType.equals("2")) {// 点行业查询小类统计 传行业id 大类id为空
					List maxTypeList = getMaxTypeList(unitId);
					for (TbCorpType type : (List<TbCorpType>) maxTypeList) {
						typeIds.add(type.getId() + "");
					}
					typeList = getMinTypeList("", typeIds, unitId);
				} else {// 点属地查询小类 传用户dept/unit id，大类id为空
					List maxTypList;
					if (user.getTbUserDept() != null) {
						maxTypList = getMaxTypeList(user.getTbUserDept().getId().toString());
					} else if (user.getTbUserUnit() != null) {
						maxTypList = getMaxTypeList(user.getTbUserUnit().getId().toString());
					} else {
						maxTypList = getMaxTypeList("");// 管理员 dept 和unit都为空
					}
					for (TbCorpType type : (List<TbCorpType>) maxTypList) {
						typeIds.add(type.getId() + "");
					}
					typeList = getMinTypeList("", typeIds, unitId);
				}
				hqlString = hqlString.replace("?", "i.min_type_id");
				hqlString = hqlString.replace("!", "i.min_type_name");
				this.initTypePageData(hqlString, typeList, "", str, total + "", titleName);
			} else if ("3".equals(tjType)) {// 行业
				htmlTitle = "行业名称";
				tjTypeFlag = "hy_id";
				this.setTjType("3");
				titleName = "行业名称";
				if (initType.equals("1")) {
//					hqlString = hqlString.replace(" group ", " and i.unit_id is not null group ");
				}
				typeList = getHyList();
				hqlString = hqlString.replace("?", "i.hy_id");
				hqlString = hqlString.replace("!", "i.hy_name");
				this.initPageData(hqlString, typeList, "", str, total + "", titleName);
			} else if ("4".equals(tjType)) {// 大类
				htmlTitle = "企业大类名称";
				tjTypeFlag = "max_type_id";
				this.setTjType("4");
				titleName = "企业类型大类";
				if (initType.equals("1")) {
//					hqlString = hqlString.replace(" group ", " and i.unit_id is not null group ");
				}
				if (initType.equals("2")) {
					typeList = getMaxTypeList(unitId);
				} else {
					if (user.getTbUserDept() != null) {
						typeList = getMaxTypeList(user.getTbUserDept().getId().toString());
					} else if (user.getTbUserUnit() != null) {
						typeList = getMaxTypeList(user.getTbUserUnit().getId().toString());
					} else {
						typeList = getMaxTypeList("");// 管理员 dept 和unit都为空
					}
				}
				hqlString = hqlString.replace("?", "i.max_type_id");
				hqlString = hqlString.replace("!", "i.max_type_name");
				this.initTypePageData(hqlString, typeList, "", str, total + "", titleName);
			} else if ("1".equals(tjType)) {// 属地
				htmlTitle = "属地名称";
				tjTypeFlag = "county_id";
				this.setTjType("1");
				titleName = "属地";
				typeList = getDeptList();
				hqlString = hqlString.replace(" group ", " and i.county_id is not null group ");
				if (grade == 0 || grade == 1 || grade == 6 || grade == 8 || grade == 2 || grade == 3 || grade == 4 || grade == 5 || (user.getTbUserDept() != null && (user.getTbUserDept().getId().toString().equals("3281") || user.getTbUserDept().getId().toString().equals("5291")))) {
					hqlString = hqlString.replace("?", "i.county_id");
					hqlString = hqlString.replace("!", "i.county_name");
				} else {
					hqlString = hqlString.replace("?", "i.unit_id");
					hqlString = hqlString.replace("!", "i.unit_name");
				}
				this.initPageData(hqlString, typeList, "", str, total + "", titleName);
			}
			if (exportExcelFlag == null || exportExcelFlag.equals("")) {
				return SUCCESS;
			} else {
				return null;
			}
		} catch (Exception e) {
			Loggers.error("TjSdCorp getShudiTypeTj 出错" + e);
			e.printStackTrace();
		}
		return ERROR;
	}

	/**
	 * 构造页面显示列表
	 * 
	 * @param hql1
	 *            当前类别下已有企业查询字符串
	 * @param typeList
	 *            （属地，乡镇，行业，大类，小类统计） 列表
	 * @param hql3
	 *            企业总数
	 * @param str
	 *            页面图标字符串
	 * @param privateCounts
	 *            每小项类数
	 * @param titleName
	 *            导出excel中 的标题和文件名
	 * @throws Exception
	 */
	protected void initPageData(String hql1, List typeList, String hql3, StringBuffer str, String privateCounts, String titleName) throws Exception {
		htmlList = new ArrayList();
		sumList = new ArrayList();
		List dataList = new ArrayList();// 用于excel文件的数据承载
		String totalCounts = "";
		try {
			List<Object[]> gradeList = (List<Object[]>) this.utilService.getObjectBySql(hql1, 0, 0);
			Double csize = null;
			DecimalFormat df = new DecimalFormat("0.00");
			int rowSum = 0; // 横行合计
			int cellSum1 = 0;// 纵向合计 A
			int cellSum2 = 0;// 纵向合计 B
			int cellSum3 = 0;// 纵向合计 C
			int cellSum4 = 0;// 纵向合计 D
			int cellSum5 = 0;// 未评级
			if (!"".equals(hql3)) {
				List<Integer> total = (List<Integer>) this.utilService.getObjectBySql(hql3, 0, 0);// 获得总企业数
				if (total.size() > 0) {
					csize = Double.parseDouble(total.get(0) + "");
					totalCounts = total.get(0) + "";
				}
			} else {
				totalCounts = privateCounts;
				csize = Double.parseDouble(totalCounts);
			}
			for (int i = 0; i < typeList.size(); i++) {
				Object[] resultArray = new Object[] { "", "", 0, 0, 0, 0, 0, 0, "0.00%" };
				TbUserDept obj = (TbUserDept) typeList.get(i);
				resultArray[0] = obj.getDeptName();
				resultArray[1] = obj.getId();
				for (int j = 0; j < gradeList.size(); j++) {
					Object[] gradeArray = new Object[3];
					gradeArray = (Object[]) gradeList.get(j);
					if (obj.getId().toString().equals(gradeArray[0].toString())) { // 类型编号相等
						if (gradeArray[2] == null) { // null未评级
							resultArray[6] = gradeArray[3];
							cellSum5 += Integer.parseInt(gradeArray[3] == null ? "0" : gradeArray[3].toString());
							// cellSum5 +=
							// Integer.parseInt(gradeArray[3].toString());
						} else if ("A".equals(gradeArray[2].toString())) {
							resultArray[2] = gradeArray[3];
							cellSum1 += Integer.parseInt(gradeArray[3].toString());
						} else if ("B".equals(gradeArray[2].toString())) {
							resultArray[3] = gradeArray[3];
							cellSum2 += Integer.parseInt(gradeArray[3].toString());
						} else if ("C".toString().equals(gradeArray[2])) {
							resultArray[4] = gradeArray[3];
							cellSum3 += Integer.parseInt(gradeArray[3].toString());
						} else if ("D".toString().equals(gradeArray[2])) {
							resultArray[5] = gradeArray[3];
							cellSum4 += Integer.parseInt(gradeArray[3].toString());
						}
						rowSum += Integer.parseInt(gradeArray[3].toString());
					}
				}
				resultArray[7] = rowSum;
				str.append("<set name='" + resultArray[0].toString() + "' value='" + resultArray[7] + "'/>");
				if (csize != 0) {
					Double objsize = Double.parseDouble(String.valueOf(rowSum));
					Double cnum = objsize / csize * 100;
					if (!cnum.isNaN()) {
						resultArray[8] = df.format(cnum) + "%";
					}
				} else {
					resultArray[8]= "0.00%";
				}
				rowSum = 0;// 清除
				htmlList.add(resultArray);
				// 导出excel中的单项数据 因为excel中没有单项id，所以重新组建一个Object[]
				dataList.add(new Object[] { resultArray[0], resultArray[2], resultArray[3], resultArray[4], resultArray[5], resultArray[6], resultArray[7], resultArray[8] });
			}
			xmlString = str.toString();
			Object[] sumArray = new Object[9];
			sumArray[0] = "合计";
			sumArray[1] = "";
			sumArray[2] = cellSum1;
			sumArray[3] = cellSum2;
			sumArray[4] = cellSum3;
			sumArray[5] = cellSum4;
			sumArray[6] = cellSum5;
			sumArray[7] = cellSum1 + cellSum2 + cellSum3 + cellSum4 + cellSum5;
			if (csize != 0) {
				Double tem = Double.valueOf(sumArray[7].toString()) / csize * 100;
				sumArray[8] = df.format(tem) + "%";
			} else {
				sumArray[8] =  "0.00%";
			}
			sumList.add(sumArray);
			dataList.add(new Object[] { sumArray[0], sumArray[2], sumArray[3], sumArray[4], sumArray[5], sumArray[6], sumArray[7], sumArray[8] });
			if (exportExcelFlag != null && exportExcelFlag.equals("1")) {
				List<String> titleList = new ArrayList<String>();
				titleList.add(titleName);
				titleList.add("A级企业");
				titleList.add("B级企业");
				titleList.add("C级企业");
				titleList.add("D级企业");
				titleList.add("未评级");
				titleList.add("合计");
				titleList.add("百分比");
				String titleString = null;
				if (upLevelName != null && !upLevelName.equals("")) {
					titleString = upLevelName + titleName + "企业统计";
				} else {
					titleString = titleName + "企业统计";
				}
				ExportExcel export = new ExportExcel(dataList, titleList, titleString);
				HSSFWorkbook workbook = export.createWorkbook();

				HttpServletResponse response = this.contextPvd.getResponse();
				response.reset();
				
				response.setContentType("application/x-msdownload");
				if(logger.isDebugEnabled()) {
					logger.debug("Excel name  is " + titleString);
					//logger.debug(new String(titleString.getBytes(), "ISO8859-1"));
					//logger.debug(new String(titleString.getBytes("UTF-8"), "ISO8859-1"));
					logger.debug(java.net.URLEncoder.encode(titleString, "UTF-8"));
				
				}
				response.addHeader("Content-Disposition","attachment; filename=\"" +java.net.URLEncoder.encode(titleString, "UTF-8")+".xls\"");
				ByteArrayOutputStream ostream = new ByteArrayOutputStream();
				ServletOutputStream servletOS = response.getOutputStream();
				workbook.write(ostream);
				servletOS.write(ostream.toByteArray());
				servletOS.flush();
				servletOS.close();
			}
		} catch (Exception e) {
			Loggers.error("TjSdCorp initPageData 出错" + e);
			e.printStackTrace();
		}
	}

	protected void initTypePageData(String hql1, List typeList, String hql3, StringBuffer str, String privateCounts, String titleName) throws Exception {
		htmlList = new ArrayList();
		sumList = new ArrayList();
		List dataList = new ArrayList();// 用于excel文件的数据承载
		String totalCounts;
		try {
			List<Object[]> gradeList = (List<Object[]>) this.utilService.getObjectBySql(hql1, 0, 0);
			Double csize = null;
			DecimalFormat df = new DecimalFormat("0.00");
			int rowSum = 0; // 横行合计
			int cellSum1 = 0;// 纵向合计 A
			int cellSum2 = 0;// 纵向合计 B
			int cellSum3 = 0;// 纵向合计 C
			int cellSum4 = 0;// 纵向合计 D
			int cellSum5 = 0;// 未评级
			if (!"".equals(hql3)) {
				List<Integer> total = (List<Integer>) this.utilService.getObjectBySql(hql3, 0, 0);// 获得总企业数
				if (total.size() > 0) {
					csize = Double.parseDouble(total.get(0) + "");
					totalCounts = total.get(0) + "";
				}
			} else {
				totalCounts = privateCounts;
				csize = Double.parseDouble(totalCounts);
			}
			for (int i = 0; i < typeList.size(); i++) {
				Object[] resultArray = new Object[] { "", "", 0, 0, 0, 0, 0, 0, "0.00%" };
				TbCorpType obj = (TbCorpType) typeList.get(i);
				resultArray[0] = obj.getTypeName();
				resultArray[1] = obj.getId();
				for (int j = 0; j < gradeList.size(); j++) {
					Object[] gradeArray = new Object[3];
					gradeArray = (Object[]) gradeList.get(j);
					if (obj.getId().toString().equals(gradeArray[0].toString())) { // 类型编号相等
						if (gradeArray[2] == null) { // null未评级
							resultArray[6] = gradeArray[3];
							cellSum5 += Integer.parseInt(gradeArray[3].toString());
						} else if ("A".equals(gradeArray[2].toString())) {
							resultArray[2] = gradeArray[3];
							cellSum1 += Integer.parseInt(gradeArray[3].toString());
						} else if ("B".equals(gradeArray[2].toString())) {
							resultArray[3] = gradeArray[3];
							cellSum2 += Integer.parseInt(gradeArray[3].toString());
						} else if ("C".toString().equals(gradeArray[2])) {
							resultArray[4] = gradeArray[3];
							cellSum3 += Integer.parseInt(gradeArray[3].toString());
						} else if ("D".toString().equals(gradeArray[2])) {
							resultArray[5] = gradeArray[3];
							cellSum4 += Integer.parseInt(gradeArray[3].toString());
						}
						rowSum += Integer.parseInt(gradeArray[3].toString());
					}
				}
				resultArray[7] = rowSum;
				str.append("<set name='" + resultArray[0].toString() + "' value='" + resultArray[7] + "'/>");
				if (csize != 0) {
					Double objsize = Double.parseDouble(String.valueOf(rowSum));
					Double cnum = objsize / csize * 100;
					if (!cnum.isNaN()) {
						resultArray[8] = df.format(cnum) + "%";
					}
				} else {
					resultArray[8] =  "0.00%";
				}
				rowSum = 0;// 清除
				htmlList.add(resultArray);
				// 导出excel中的单项数据 因为excel中没有单项id，所以重新组建一个Object[]
				dataList.add(new Object[] { resultArray[0], resultArray[2], resultArray[3], resultArray[4], resultArray[5], resultArray[6], resultArray[7], resultArray[8] });
			}
			xmlString = str.toString();
			Object[] sumArray = new Object[9];
			sumArray[0] = "合计";
			sumArray[1] = "";
			sumArray[2] = cellSum1;
			sumArray[3] = cellSum2;
			sumArray[4] = cellSum3;
			sumArray[5] = cellSum4;
			sumArray[6] = cellSum5;
			sumArray[7] = cellSum1 + cellSum2 + cellSum3 + cellSum4 + cellSum5;
			if (csize != 0) {
				Double tem = Double.valueOf(sumArray[7].toString()) / csize * 100;
				sumArray[8] = df.format(tem) + "%";
			} else {
				sumArray[8]= "0.00%";
			}
			sumList.add(sumArray);
			dataList.add(new Object[] { sumArray[0], sumArray[2], sumArray[3], sumArray[4], sumArray[5], sumArray[6], sumArray[7], sumArray[8] });
			if (exportExcelFlag != null && exportExcelFlag.equals("1")) {
				List<String> titleList = new ArrayList<String>();
				titleList.add(titleName);
				titleList.add("A级企业");
				titleList.add("B级企业");
				titleList.add("C级企业");
				titleList.add("D级企业");
				titleList.add("未评级");
				titleList.add("合计");
				titleList.add("百分比");
				String titleString = null;
				if (upLevelName != null && !upLevelName.equals("")) {
					titleString = upLevelName + titleName + "企业统计";
				} else {
					titleString = titleName + "企业统计";
				}
				ExportExcel export = new ExportExcel(dataList, titleList, titleString);
				HSSFWorkbook workbook = export.createWorkbook();

				HttpServletResponse response = this.contextPvd.getResponse();
				response.reset();
				//response.setHeader("charset","ISO8859-1");  
				response.setContentType("application/x-msdownload");
				response.addHeader("Content-Disposition", "attachment; filename=\"" +java.net.URLEncoder.encode(titleString, "UTF-8")+ ".xls\"");
				ByteArrayOutputStream ostream = new ByteArrayOutputStream();
				ServletOutputStream servletOS = response.getOutputStream();
				workbook.write(ostream);
				servletOS.write(ostream.toByteArray());
				servletOS.flush();
				servletOS.close();
			}
		} catch (Exception e) {
			Loggers.error("TjSdCorp initPageData 出错" + e);
			e.printStackTrace();
		}
	}

	/**
	 * 点击数据。得到的企业列表方法
	 * 
	 * @return
	 */
	public String getTjCorpList() {
		try {
			int count = 0;
			StringBuffer sqlBuffer = new StringBuffer("select count(*) from tb_tj_corp_info_view v where v.is_dele=0 and v.corp_size=1 ");
			if (corpGrade != null && !"".equals(corpGrade) && !"null".equals(corpGrade)) {
				sqlBuffer.append(" and v.corp_grade = '").append(corpGrade).append("'");
			}
			if ("null".equals(corpGrade)) {
				sqlBuffer.append(" and v.corp_grade is null ");
			}
			 if ("2".equals(tjType)){//乡镇
				 sqlBuffer.append(" and v.unit_id is not null");
			 }
			 if (tjTypeFlag3 != null && !"".equals(tjTypeFlag3)) {
					sqlBuffer.append(" and " + tjTypeFlag3.split(":")[0] + " = ").append(tjTypeFlag3.split(":")[1]);
				}
			 if (tjTypeFlag4 != null && !"".equals(tjTypeFlag4)) {
					sqlBuffer.append(" and " + tjTypeFlag4.split(":")[0] + " like '%").append(tjTypeFlag4.split(":")[1]).append("%' ");
				}
			if (tjTypeFlag2 != null && !"".equals(tjTypeFlag2)) {
				sqlBuffer.append(" and " + tjTypeFlag2.split(":")[0] + " = ").append(tjTypeFlag2.split(":")[1]);
			}
			// 数据库查询的列名和id用 列名:id 方法传递，加以拆分
			if (tjTypeFlag != null && !"".equals(tjTypeFlag)) {
				sqlBuffer.append(" and " + tjTypeFlag.split(":")[0] + " = ").append(tjTypeFlag.split(":")[1]);
			}
			count = Integer.parseInt(this.utilService.getObjectBySql(sqlBuffer.toString()));
			if (count > 0) {
				Page page = new Page(setPageSize(10), setPageNum(1), count);
				this.setPage(page);
				corpList = (List) this.utilService.getObjectBySql(sqlBuffer.toString().replace("count(*) ", " * "), page.getStartRow(), page.getSize());
			}
			this.setResult("corp_list");
			return SUCCESS;
		} catch (Exception e) {
			Loggers.error("TjSdCorp getTjCorpList 出错" + e);
			e.printStackTrace();
		}
		return ERROR;
	}

	/**
	 * 解码
	 * 
	 * @param string
	 *            要解码的字符串
	 * @return
	 */
	public String checkSearch(String string) {
		if (this.getSearch() == null || !"1".equals(this.getSearch())) {
			string = this.contextPvd.decode(string);
		}
		return string;
	}

	public void initExcel() {

	}

	public String getUpLevelName() {
		return upLevelName;
	}

	public void setUpLevelName(String upLevelName) {
		this.upLevelName = upLevelName;
	}

	public List getCorpList() {
		return corpList;
	}

	public String getTjTypeFlag() {
		return tjTypeFlag;
	}

	public void setTjTypeFlag(String tjTypeFlag) {
		this.tjTypeFlag = tjTypeFlag;
	}

	public String getCorpGrade() {
		return corpGrade;
	}

	public void setCorpGrade(String corpGrade) {
		this.corpGrade = corpGrade;
	}

	public String getCountyId() {
		return countyId;
	}

	public void setCountyId(String countyId) {
		this.countyId = countyId;
	}

	public String getExportExcelFlag() {
		return exportExcelFlag;
	}

	public void setExportExcelFlag(String exportExcelFlag) {
		this.exportExcelFlag = exportExcelFlag;
	}

	public String getHyId() {
		return hyId;
	}

	public void setHyId(String hyId) {
		this.hyId = hyId;
	}

	public String getMaxTypeId() {
		return maxTypeId;
	}

	public void setMaxTypeId(String maxTypeId) {
		this.maxTypeId = maxTypeId;
	}

	public String getMinTypeId() {
		return minTypeId;
	}

	public void setMinTypeId(String minTypeId) {
		this.minTypeId = minTypeId;
	}

	public void setCorpList(List corpList) {
		this.corpList = corpList;
	}

	public String getXmlString() {
		return xmlString;
	}

	public void setXmlString(String xmlString) {
		this.xmlString = xmlString;
	}

	public List getSumList() {
		return sumList;
	}

	public void setSumList(List sumList) {
		this.sumList = sumList;
	}

	public String getInitType() {
		return initType;
	}

	public void setInitType(String initType) {
		this.initType = initType;
	}

	public String getTjType() {
		return tjType;
	}

	public void setTjType(String tjType) {
		this.tjType = tjType;
	}

	public String getUnitId() {
		return unitId;
	}

	public void setUnitId(String unitId) {
		this.unitId = unitId;
	}

	public String getTotalCounts() {
		return totalCounts;
	}

	public void setTotalCounts(String totalCounts) {
		this.totalCounts = totalCounts;
	}

	public List getHtmlList() {
		return htmlList;
	}

	public void setHtmlList(List htmlList) {
		this.htmlList = htmlList;
	}

	public String getTjTypeFlag3() {
		return tjTypeFlag3;
	}

	public void setTjTypeFlag3(String tjTypeFlag3) {
		this.tjTypeFlag3 = tjTypeFlag3;
	}

	public String getTjTypeFlag4() {
		return tjTypeFlag4;
	}

	public void setTjTypeFlag4(String tjTypeFlag4) {
		this.tjTypeFlag4 = tjTypeFlag4;
	}

}
